<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:o="http://openfaces.org/"
	xmlns:s="http://jboss.com/products/seam/taglib"
	template="/WEB-INF/esquema/plantillaworkflow.xhtml">

	<ui:define name="mainControls">
		<h:form>
			<a4j:commandButton value="#{messages['approval.btn.applychanges']}" oncomplete="#{rich:component('strict-confirmation-dialog')}.show()">
				<f:setPropertyActionListener target="#{dialogHelper.confirmMsg}" value="#{messages['approval.applychanges']}"/>
				<f:setPropertyActionListener target="#{dialogHelper.jsFunction}" value="applychanges();"/>
			</a4j:commandButton>
			<a4j:commandButton value="#{messages['approval.btn.denychanges']}" oncomplete="#{rich:component('strict-confirmation-dialog')}.show()">
				<f:setPropertyActionListener target="#{dialogHelper.confirmMsg}" value="#{messages['approval.denychanges']}"/>
				<f:setPropertyActionListener target="#{dialogHelper.jsFunction}" value="denychanges();"/>
			</a4j:commandButton>
			<o:commandButton value="#{messages['button.l8r']}" onclick="pause();" type="button" />
		</h:form>
	</ui:define>

	<ui:define name="extraControls">
		<h:form>
			<a4j:commandButton value="#{messages['button.back2dataentry']}" oncomplete="#{rich:component('confirmation-dialog')}.show()">
				<f:setPropertyActionListener target="#{dialogHelper.confirmMsg}" value="#{messages['approval.back2dataentry']}"/>
				<f:setPropertyActionListener target="#{dialogHelper.jsFunction}" value="back2dataentry();"/>
			</a4j:commandButton>
			<a4j:commandButton value="#{messages['button.back2analysis']}" oncomplete="#{rich:component('strict-confirmation-dialog')}.show()">
				<f:setPropertyActionListener target="#{dialogHelper.confirmMsg}" value="#{messages['approval.back2analysis']}"/>
				<f:setPropertyActionListener target="#{dialogHelper.jsFunction}" value="back2analysis();"/>
			</a4j:commandButton>
		</h:form>
	</ui:define>

	<ui:define name="body">
		<div align="center">
			<br/>
			<strong>#{messages['approval.header']}</strong>
			<rich:separator lineType="solid"/>
			<br/>

			<ui:include src="/WEB-INF/includes/showHelpIncl.xhtml">
				<ui:param name="width" value="500" />
				<ui:param name="mainMessage" value="#{messages['approval.message']}:" />
				
				<ui:param name="msgBullet"  value="#{messages['approval.bullet1']}" />
				<ui:param name="msgBullet1" value="#{messages['approval.bullet2']}" />
				<ui:param name="msgBullet2" value="#{messages['approval.bullet3']}" />
			</ui:include>

			<br/>
		</div>
		<h:form>
			<br />
			<ui:include src="/workflow/viewTransaction.xhtml" />
			
			<br />
			<br />
			
			<rich:panel header="Edicion de datos">
				<rich:simpleTogglePanel switchType="client" label="DERECHOS, RESTRICCIONES Y RESPONSABILIDADES">
					<table style="width: 100%;" cellpadding="10">
						<tr valign="top">
							<th style="width: 50%;">
								<div align="center">
									ANTES
								</div>
								<rich:separator lineType="solid"/>
							</th>
							<th style="width: 50%;">
								<div align="center">
									DESPUES
								</div>
								<rich:separator lineType="solid"/>
							</th>
						</tr>
						<tr valign="top">
							<td>
								<ui:include src="viewTransaction/viewAllParcelsRRRsModifications.xhtml">
									<ui:param name="listIdx" value="0" />
								</ui:include>
							</td>
							<td>
								<ui:include src="viewTransaction/viewAllParcelsRRRsModifications.xhtml">
									<ui:param name="listIdx" value="1" />
								</ui:include>
							</td>
						</tr>
					</table>
				</rich:simpleTogglePanel>
				<br />
				<rich:simpleTogglePanel switchType="client" label="DATOS DE LOS INMUEBLES">
					<table style="width: 100%;" cellpadding="10">
						<tr valign="top">
							<th style="width: 50%;">
								<div align="center">
									ANTES
								</div>
								<rich:separator lineType="solid"/>
							</th>
							<th style="width: 50%;">
								<div align="center">
									DESPUES
								</div>
								<rich:separator lineType="solid"/>
							</th>
						</tr>
						<tr valign="top">
							<td>
								<ui:include src="viewTransaction/viewAllParcelsDataModifications.xhtml">
									<ui:param name="listIdx" value="0" />
								</ui:include>
							</td>
							<td>
								<ui:include src="viewTransaction/viewAllParcelsDataModifications.xhtml">
									<ui:param name="listIdx" value="1" />
								</ui:include>
							</td>
						</tr>
					</table>
				</rich:simpleTogglePanel>
			</rich:panel>
			<br />
			
			<a4j:jsFunction name="applychanges" action="#{transactionHelper.endApproval}"/>
			<a4j:jsFunction name="denychanges" action="#{transactionHelper.endApprovalDenied}"/>
			<a4j:jsFunction name="back2dataentry" action="#{transactionHelper.approvalBackToDataEntry}"/>
			<a4j:jsFunction name="back2analysis" action="#{transactionHelper.approvalBackToAnalysis}"/>
			<a4j:jsFunction name="pause" action="home" />
		</h:form>
	</ui:define>
</ui:composition>
